﻿@page
@model EditModel
@{
    ViewBag.Title = "应用信息";
    Layout = "_Modal";
}

<form method="post">
    <div class="form-group">
        <label>应用程序Id</label>
        <input class="form-control" asp-for="Input!.Id" readonly="readonly" />
    </div>
    <div class="form-group">
        <label>密钥</label>
        <div class="input-group-append">
            <input class="form-control" asp-for="Input.AppSecret" readonly="readonly" />
            <a id="refresher" asp-page-handler="General" _click="action" title="重新生成密钥！"><i class="bi-disc"></i></a>
        </div>
    </div>
    <div class="form-group">
        <label>应用名称</label>
        <input class="form-control" asp-for="Input.Name" />
        <span asp-validation-for="Input.Name" class="text-danger"></span>
    </div>
    <div class="form-group">
        <label>选择用户</label>
        <gt:user-dropdownlist default-text="选择用户" default-value="0" class="form-control" asp-for="Input.UserId"></gt:user-dropdownlist>
        <span asp-validation-for="Input.UserId" class="text-danger"></span>
    </div>
    <div class="form-group">
        <label>描述</label>
        <textarea rows="3" class="form-control" asp-for="Input.Summary"></textarea>
    </div>
</form>

<script type="text/javascript">
    onrender(context => {
        $('#refresher', context).exec(current => {
            current.on('success',
                (c, d) => {
                    $('#Input_AppSecret', context).val(d.appSecret);
                });
        });
    });
</script>